﻿CREATE TABLE [dbo].[dscGateway_Study] (
    [InstanceUID]                   VARCHAR (100) NOT NULL,
    [ID]                            VARCHAR (50)  NOT NULL,
    [Description]                   VARCHAR (100) NOT NULL,
    [StudyDateTime]                 DATETIME      NOT NULL,
    [NumberOfStudyRelatedInstances] SMALLINT      DEFAULT ((0)) NOT NULL,
    [NumberOfStudyRelatedSeries]    SMALLINT      DEFAULT ((0)) NOT NULL,
    [ModalitiesInStudy]             VARCHAR (100) NULL,
    [ReferringPhysiciansName]       VARCHAR (100) NULL,
    [AccessionNumber]               VARCHAR (50)  NULL,
    [PatientID]                     INT           NOT NULL,
    CONSTRAINT [PK_dscGateway_Study] PRIMARY KEY CLUSTERED ([InstanceUID] ASC),
    CONSTRAINT [FK_dscGateway_Study_dscGateway_Patient] FOREIGN KEY ([PatientID]) REFERENCES [dbo].[dscGateway_Patient] ([PatientID])
);

